//
//  YHDetailViewController.swift
//  YHWeibo
//
//  Created by 昱含 on 16/5/19.
//  Copyright © 2016年 YuHan. All rights reserved.
//

import UIKit

class YHDetailViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = UIColor.whiteColor()
        
        //解决返回按钮的手势消失的方法:在导航视图控制器重新设置边缘返回手势的代理
//        let back = UIBarButtonItem(imageName: "navigationbar_back_withtext", title: "返回", target: self, action: #selector(YHDetailViewController.back))
//        
//        self.navigationItem.leftBarButtonItem = back
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .Plain, target: self, action: #selector(next))
        
    }
    
    @objc private func next() {
        let next = YHDetailViewController()
        navigationController?.pushViewController(next, animated: true)
        
    }
//    @objc private func back() {
//        navigationController?.popToRootViewControllerAnimated(true)
//    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
